import React, { useState } from "react";

import TodoAdd from "./components/TodoAdd";
import TodoList from "./components/TodoList";
import TodoFooter from "./components/TodoFooter";

export default function App() {
  const [showFooter, setShowFooter] = useState(true);
  return (
    <div className="todo">
      <button
        onClick={() => {
          setShowFooter((prevShowFooter) => !showFooter);
        }}
      >
        切换 showFooter
      </button>
      <TodoAdd />

      <TodoList />

      {showFooter && <TodoFooter />}
    </div>
  );
}
